package cn.lzx.industry.processor;

import cn.lzx.industry.material.People;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

/**
 * Created by lizhenxing on 2018/2/5.
 */
@Aspect
@Slf4j
@Component
public class ProcessorD{

    @Around(value = "cn.lzx.industry.assist.ProcessorAssist.pointPeopleThis(people)")
    public Object check(ProceedingJoinPoint joinPoint, People people) throws Throwable {
        people.setIsSafe(true);
        log.info("this 是否允许通过安检,{}", people);
        return joinPoint.proceed(new Object[]{people});
    }

    @Around(value = "cn.lzx.industry.assist.ProcessorAssist.pointPeopleTarget(people)")
    public Object check1(ProceedingJoinPoint joinPoint, People people) throws Throwable {
        people.setIsSafe(true);
        log.info("target 是否允许通过安检,{}", people);
        return joinPoint.proceed(new Object[]{people});
    }


}
